﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Current.aspx.vb" MasterPageFile="~/Site.master" Inherits="AdventureWorks.Current" %>
<%@ Register Src="~/DynamicData/Content/GridViewPager.ascx" TagName="GridViewPager" TagPrefix="asp" %>
<%@ Register TagPrefix="params" Assembly="AdventureWorks" Namespace="AdventureWorks.Parameters" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />
    <asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true" HeaderText="List of validation errors" />
    <asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" />
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource" AutoGenerateColumns="False"
        AutoGenerateSelectButton="False" AutoGenerateEditButton="False" AutoGenerateDeleteButton="False"
        AllowPaging="True" AllowSorting="True" EnableQueryStringSelection="True" CssClass="gridview"
        AlternatingRowStyle-CssClass="even">
        <Columns>
            <asp:TemplateField HeaderText="Name" SortExpression="Name">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ProductId", "~/Products/Details.aspx?ProductId={0}") %>'>
                        <asp:DynamicControl ID="DynamicControl1" DataField="Name" runat="server" />
                    </asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:DynamicField HeaderText="Product Category" DataField="ProductCategory" />
            <asp:DynamicField HeaderText="Product Model" DataField="ProductModel" />
            <asp:DynamicField HeaderText="Product Number" DataField="ProductNumber" />
            <asp:DynamicField HeaderText="Color" DataField="Color" />
            <asp:DynamicField HeaderText="Standard Cost" DataField="StandardCost" />
            <asp:DynamicField HeaderText="List Price" DataField="ListPrice" />
            <asp:DynamicField HeaderText="Size" DataField="Size" />
            <asp:DynamicField HeaderText="Weight" DataField="Weight" />
        </Columns>
        <PagerStyle CssClass="Footer" />
        <PagerTemplate>
            <asp:GridViewPager ID="GridViewPager1" runat="server" />
        </PagerTemplate>
        <EmptyDataTemplate>
            There are currently no items in this table.
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:DynamicLinqDataSource ID="GridDataSource" TableName="Products" ContextTypeName="AdventureWorks.BusinessObjects.AdventureWorksDataContext" runat="server">
        <WherePredicateParameters>
            <params:CurrentProductParameter />
        </WherePredicateParameters>
    </asp:DynamicLinqDataSource>
</asp:Content>